<template>
  <view class="home">
    <customtop top_title="我的收藏"></customtop>
    <view class="list" v-if="list.length">
      <template v-for="(item, index) in list">
        <globalItem :item="item"></globalItem>
      </template>
    </view>
    <view class="empty" v-else>
      <u-empty mode="data" text="未找到相关内容"> </u-empty>
    </view>
  </view>
</template>

<script>
import customtop from "@/components/customtop";
import { request } from "@/utils/http.js";
import globalItem from "@/components/item/index";
export default {
  components: { customtop, globalItem },
  onLoad(options) {
    this.getColletList();
  },
  data() {
    return {
      list: [],
    };
  },
  methods: {
    getColletList() {
      request.post("/xiangmushe/getCollectArticleList").then(({ data }) => {
        console.log(data);
        this.list = data.data;
      });
    },
  },
};
</script>

<style lang="scss" scoped>
page {
  background-color: #fff;
}
.empty {
  margin-top: 40rpx;
}
</style>
